import { ElLoading } from "element-plus"

let GlobalLoading: any = null

export default {
  show(text = '拼命加载中...') {
    this.hide()
    GlobalLoading = ElLoading.service({
      lock: true,
      text,
      background: 'rgba(255, 255, 255, 0.9)'
    })
  },
  hide() {
    GlobalLoading?.close()
  },
  getStatus() {
    return GlobalLoading?.closed
  }
}
